#pragma once

#include "FileWritter.h"

class FileWritterPool : public FileWritter
{
public:
	FileWritterPool();
	virtual ~FileWritterPool();

	bool Init(IN stringc& strFile, IN u32 useMemory);
	void Uninit();

	bool WriteData(IN u8c* data, IN u32 size);
	bool Writeu64(IN u64 v);
	bool Writeu32(IN u32 v);
	bool Writeu16(IN u16 v);
	bool Writeu8(IN u8 v);

	bool ForceToWrite();

protected:
	void Clear();
	bool WriteDataToFileDirect(IN u8c* data, IN u32 size);

private:
	// parameter
	u32 m_useMemory;

	//
	HANDLE m_hFile;
	
	u8* m_pool;
	u32 m_fillSize;

};